/*
 * URLDownloader.cpp
 *
 *  Created on: Mar 7, 2011
 *      Author: cnwilson
 */

#include "../inc/URLDownloader.h"

			URLDownloader::URLDownloader(){

			}

			string* URLDownloader::download(URL *address){
            	string *HTMLcode = new string("");
				try {
					string temp(address->getAddress());
					URLInputStream stream(temp);

					while(!stream.IsDone()) {
						*HTMLcode+=stream.Read();
					}
					return HTMLcode;
				} catch (CS240Exception & e) {
					delete HTMLcode;
					throw e;
				}



            }

